import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BfExperienceLogVO, BfExperienceLogForm, BfExperienceLogQuery } from '@/api/app/BfExperienceLog/types';

/**
 * 查询经验记录LOG列表
 * @param query
 * @returns {*}
 */

export const listBfExperienceLog = (query?: BfExperienceLogQuery): AxiosPromise<BfExperienceLogVO[]> => {
  return request({
    url: '/app/BfExperienceLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询经验记录LOG详细
 * @param id
 */
export const getBfExperienceLog = (id: string | number): AxiosPromise<BfExperienceLogVO> => {
  return request({
    url: '/app/BfExperienceLog/' + id,
    method: 'get'
  });
};

/**
 * 新增经验记录LOG
 * @param data
 */
export const addBfExperienceLog = (data: BfExperienceLogForm) => {
  return request({
    url: '/app/BfExperienceLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改经验记录LOG
 * @param data
 */
export const updateBfExperienceLog = (data: BfExperienceLogForm) => {
  return request({
    url: '/app/BfExperienceLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除经验记录LOG
 * @param id
 */
export const delBfExperienceLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/BfExperienceLog/' + id,
    method: 'delete'
  });
};
